package com.onadake.web.controller.user;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.web.multipart.MultipartFile;

/**
 * Model object for capturing data of the posted messages.
 * 
 * @author radek.hecl
 *
 */
public class PostMessageModel {

    /**
     * Message targets. Comma separated user codes.
     */
    @SuppressWarnings("unused")
    private String targets;
    
    /**
     * Message text.
     */
    private String text;
    
    /**
     * File enclosed to the message.
     */
    @SuppressWarnings("unused")
    private MultipartFile file;

    /**
     * Creates new instance.
     */
    public PostMessageModel() {
    }

    /**
     * Sets message targets of this message. These are comma separated user codes.
     * 
     * @param targets targets of this message
     */
    public void setTargets(String targets) {
        this.targets = targets;
    }
    
    /**
     * Returns message text.
     * 
     * @return message text
     */
    public String getText() {
        return text;
    }
    
    /**
     * Sets text of this message.
     * 
     * @param text text of this message
     */
    public void setText(String text) {
        this.text = text;
    }
    
    /**
     * Sets file of this message.
     * 
     * @param file file of this message 
     */
    public void setFile(MultipartFile file) {
        this.file = file;
    }
    
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
